using System.Collections;
using System.Collections.Generic;
using Agatha.Common;

namespace  Source.Web.FrameWork
{
    public interface IViewPart
    {
        bool IsPostBack { get; }
        IDictionary State { get; }

        void DataBind();
        void DisplayMessages(string message);
        void DisplayMessages(string message, params string[] parameters);
        void DisplayMessages(IEnumerable<string> messages);
        void DisplayMessages(IEnumerable<string> messages, IEnumerable<IEnumerable<string>> parameters);
        void DisplayMessageBox(string message);
    }

    public interface IViewPartWithPartController : IViewPart
    {
        IPartController GetUntypedPartController(IRequestDispatcher dispatcher);
    }

    /// <summary>
    /// Each User Control or Web Part must implement this interface instead of the regular IView interface.
    /// </summary>
    public interface IViewPart<TPartController> : IViewPartWithPartController
        where TPartController : IPartController
    {
        TPartController GetPartController(IRequestDispatcher dispatcher);
    }
}